import Vue from "vue";
import Vuex from 'vuex'
// 导入user.js
import user from './modules/user'

// 导入购物车模块 cart.js
import cart from './modules/cart'
Vue.use(Vuex)

const store = new Vuex.Store({
    state: {
    },
    mutations: {
    },
    actions: {

    },
    getters: {
        token(state){
            return state.user.userInfo.token
        }
    },
    // 导入user
    modules: {
        user,
        cart
    }
})

export default store